<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$Think.config.site.title} - 弹出所有电子锁</title>
    <meta name="keywords" content="{$Think.config.site.keywords}">
    <meta name="description" content="{$Think.config.site.description}">
    <link href="{$Think.config.site.resource_url}css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/chosen/chosen.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/awesome-bootstrap-checkbox/awesome-bootstrap-checkbox.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/animate.min.css" rel="stylesheet">
    <link href="{$Think.config.site.resource_url}css/style.min.css?v=4.0.0" rel="stylesheet">
</head>
<body class="gray-bg">
    <div id="show">
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-sm-12">
                    <div class="ibox float-e-margins">
                        <?php if(isset($id)){?>
                        <div class="ibox-content">
                            <div class="alert">
                               	<h3>{:lang('一键弹出')}<font style="color: #000;">{$id}</font>{:lang('所有的电子锁吗')}？</h3>
                               	<p>&nbsp;</p>
                               	<button data-toggle="button" class="btn btn-primary" type="button" id="cancel">{:lang('取消')}</button>　　　　<button data-toggle="button" class="btn btn-primary" type="button" id="restart" data-id="{$id}">{:lang('确定')}</button>
                            </div>
                        </div>
                        <?php }else{ ?>
                        
                            <div class="ibox-content">
                            <br/><br/><br/>
                                <h3 style="text-align: center;">{:lang('没有找到该设备')}</h3>
                            </div>
                        <?php } ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script src="{$Think.config.site.resource_url}js/jquery.min.js?v=2.1.4"></script>
    <script src="{$Think.config.site.resource_url}js/bootstrap.min.js?v=3.3.5"></script>
    <script src="{$Think.config.site.resource_url}js/plugins/layer/layer.js"></script>
    <script type="text/javascript">
    	$(function(){
    		$('#cancel').click(function(){
    			parent.location.reload();
    		});
    		$('#restart').click(function(){
    			var id = $(this).data("id");
    			$.ajax({
		            type : 'POST',
		            url  : '<?php echo \think\Request::instance()->root(); ?>/ausadmin/Equipment/openalllock?id='+id,
		            dataType : 'json',
		            data : {id:id},
		            async : false,
		            success : function(result){
		                if(0 == result.code){
		                    layer.msg(result.msg, {icon: 1});
                            parent.location.reload();
		                }else{
		                    layer.msg(result.msg, {icon: 5});
		                }
		            },
		            
		        })
    		});
    	});
    </script>
</body>
</html>